<?php

class Zend_View_Helper_Actionsdropdownitems extends Zend_View_Helper_Abstract {
    
    private $hubs = array(
        "save"      => "Save order",
        "public"    => "Public",
        "private"   => "Private",
        "active"    => "Active",
        "inactive"  => "Inactive",
        "delete"    => "Delete"        
    );

    private $devices = array(
        "save"      => "Save order",
        "static"    => "Static",
        "dynamic"   => "Dynamic",
        "active"    => "Active",
        "inactive"  => "Inactive",
        "public"    => "Public",
        "private"   => "Private",        
        "delete"    => "Delete"        
    );    
    
    private $agents = array(
        "hide"      => "Hide",
        "show"      => "Show",
        "uninstall"    => "Uninstall"
    );

    private $packages = array(
        "install"      => "Install",
        "uninstall"    => "Uninstall"
    );    
    
    public function actionsdropdownitems($page) {
        return $this->generateList($page);
    }

    public function generateList($page = "") {   
        $saction = $this->view->translate('Select action');
        $returnString = "<option value=\"\">$saction</option>\n";
        if ($page == "hubs") {
            foreach ($this->hubs as $link => $name) {
                $namet = $this->view->translate($name);
                $returnString .=  "<option value=\"$link\">$namet</option>\n";
            }
        } else if ($page == "agents") {
            foreach ($this->agents as $link => $name) {
                $namet = $this->view->translate($name);
                $returnString .=  "<option value=\"$link\">$namet</option>\n";
            }      
        } else if ($page == "devices") {
            foreach ($this->devices as $link => $name) {
                $namet = $this->view->translate($name);
                $returnString .=  "<option value=\"$link\">$namet</option>\n";
            }
        } else if ($page == "packages") {
            foreach ($this->packages as $link => $name) {
                $namet = $this->view->translate($name);
                $returnString .=  "<option value=\"$link\">$namet</option>\n";
            }
        } else {
            $returnString = "";           
        }
        return $returnString;
    }
}
?>